package com.edu.policy.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.edu.policy.domin.PageDto;
import com.edu.policy.model.DmsDevices;
import com.edu.policy.model.DmsFunctionCodes;
import com.edu.policy.service.AppDmsDevicesService;
import com.edu.policy.service.AppDmsFuncService;
import org.springframework.stereotype.Service;

@Service
public class AppDmsDevicesServiceImpl extends DmsDevicesServiceImpl implements AppDmsDevicesService {
    @Override
    public PageDto<DmsDevices> list(Integer pageSize, Integer pageNum) {
        PageDto<DmsDevices> result = new PageDto<>();
        Page<DmsDevices> page = Page.of(pageNum, pageSize);
        Page<DmsDevices> tempResult = lambdaQuery()
                .page(page);
        result.setList(tempResult.getRecords());
        result.setPages(tempResult.getPages());
        result.setTotal(tempResult.getTotal());
        result.setCurrentPage(tempResult.getCurrent());
        return result;
    }
}
